﻿using System.Web.Mvc;

namespace _4Shop_1._0.Areas.Admin
{
    public class AdminAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Admin";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {

            
            // http://domain/Admin/product/edit/1
            context.MapRoute("Edit Product", "Admin/product/edit/{productId}"
                , new { controller = "Product", action = "EditProduct" }
                , new { productId = @"\d{1,5}" });
            // http://domain/Admin/product/1
            context.MapRoute("View Details", "Admin/product/{productId}"
                , new { controller = "Product", action = "ViewProduct" }
                , new { productId = @"\d{1,5}" });
            // http://domain/Admin/products
            context.MapRoute("Show All Products", "Admin/products"
                , new { controller = "Product", action = "ShowAllProducts" });

            
            
            context.MapRoute(
                "Admin_default",
                "Admin/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );
        }
    }
}
